package com.kiki.stater.callbackdemo;

/**
 * Created by mazeyi on 2020/12/10.
 */
public class CallBackDemo {

    public CallBackInterface getTime(CallBackInterface callBackInterface){
        long time = System.currentTimeMillis();
        System.out.println("执行方法");

        return callBackInterface;
    }


    public static void main(String[] args) {
        CallBackDemo callBackDemo = new CallBackDemo();
        Test test = new Test();
        callBackDemo.getTime(test).onSuccess();
    }
}

class Test implements CallBackInterface{

    @Override
    public boolean onSuccess() {
        System.out.println(true);
        return true;
    }

    @Override
    public boolean onError() {
        System.out.println(false);
        return false;
    }
}